package ${thisPackage}.domain;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.*;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

/**
 * auto generate by wencst
 * @author ${author}
 * @since ${.now}
 */
 
<#-- NOTICE: the name attribute of @Table is intentionally unquoted  -->
@Entity
@Table(name = "${tableName}")
@Data
public class ${javaBeanName} implements Serializable {

	private static final long serialVersionUID = 1L;
<#list columns as col>
	/**
	<#if col.comment?has_content>
	 * comment: ${col.comment}
	</#if>
	<#if col.description?has_content>
	 * description: ${col.description}
	</#if>
	 */
	<#if col.primaryKey>
	@Id
	<#if col.javaType=="String">
	@GenericGenerator(name="idGenerator", strategy="uuid") //这个是hibernate的注解
	@GeneratedValue(generator="idGenerator") //使用uuid的生成策略
	<#elseif col.javaType=="Integer">
	@GeneratedValue(GenerationType.AUTO)
	</#if>
	</#if>
	@Column(name="${col.columnName}")
    private ${col.javaType} ${col.columnJavaName} ;
</#list>
}
